<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<DoveSiButta.Models.Box>" MasterPageFile="~/Views/Shared/Site.Master"  %>
<%@ Import Namespace="DoveSiButta.Helpers" %>
<asp:Content ID="Title" ContentPlaceHolderID="TitleContent" runat="server">
    <%: Model.Title %>
</asp:Content>

<asp:Content ID="details" ContentPlaceHolderID="MainContent" runat="server">

    <div id="dinnerDiv" class="vevent">

        <h2 class="summary"><%: Model.Title %></h2>

        <div id="share">
        <strong>Condividi: </strong>
        <a href="http://twitter.com/home/?source=dovesibutta&status=DoveSiButta%3A+<%: Model.Title.Truncate(40) %>+on+<%: Model.EventDate.ToString("MMM dd") %>+-+%3A+http%3A%2F%2Fdovesibutta.cloudapp.net/<%: Model.BoxID %>"  
            title="Manda un tweet" target="_blank">
            <img src="/Content/Img/icon-twitter.png" alt="Twitter" border="0" />
        </a><a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdovesibutta.cloudapp.net/<%: Model.BoxID %>"  
            title="Condividi su Facebook" target="_blank">
            <img src="/Content/Img/icon-facebook.png" alt="Facebook" border="0" />
        </a></div>

        
        <p>
     <!-- ical -->
        </p>
        
        <p>
            <strong>Quando:</strong> 
            <abbr class="dtstart" title="<%: Model.EventDate.ToString("s") %>">
                <%: Model.EventDate.ToString("MMM dd, yyyy") %> 
                <strong>@</strong>
                <%: Model.EventDate.ToShortTimeString() %>
            </abbr>
        </p>
        
        <p>
            <strong>Dove:</strong>
            <span class="location adr">
                <span class="extended-address"><%: Model.Address %></span>, 
                <span class="country-name"><%: Model.Country %></span>
                <abbr class="geo" title="<%: Model.Latitude %>;<%: Model.Longitude %>" style="display: none;">Geolocation for hCalendar</abbr>
            </span>
        </p>
        
        <p>
            <strong>Descrizione:</strong> 
            <span class="description"><%: Model.Description %></span>
            <span style="display: none;">
                <%: Html.ActionLink("URL for hCalendar", "iCal", "Services", new { id = Model.BoxID }, new { @class = "url" })%>
            </span>
        </p>
            
            <p>
            <strong>Nome File :</strong> 
            <span class="description"><%: Model.Pictures.FirstOrDefault() == null ? "" : Model.Pictures.FirstOrDefault().Picture_Filename%></span>
            <span style="display: none;">
                <%: Model.Pictures.FirstOrDefault() == null ? "" : Model.Pictures.FirstOrDefault().Picture_Filename%><!-- //GM -->
            </span>
        </p>

        <p>
            <strong>Tipo Elemento:</strong> 
            <span class="description"><%: GarbageTypes.GetValue(Model.BoxType) %></span><!-- 06-02-2012 FLAVERROR GetValue aggiunta -->
            <span style="display: none;">
                <%: Model.BoxType %><!-- //GM -->
            </span>
        </p>

        <p>
            <img src='/Pictures/<%=  Model.Pictures.FirstOrDefault() == null ? "NoPicture.jpg" : Model.Pictures.FirstOrDefault().Picture_Filename %>' width="270" alt="picture" />
          <!--   http://stackoverflow.com/questions/880515/display-image-from-database-in-asp-mvc -->
           <!-- <strong>Clicca per scaricare il file: </strong> 
            <span class="description"><a href="#">Work in progress! (ma serve?)</a></span> --><!-- //GM -->

        </p>

        <p>
            <strong>Organizzatore:</strong>
            <span class="organizer">
                <span class="vcard">
                    <span class="fn nickname"><%: Model.HostedBy %></span>
                    <span class="tel"> <%: Model.ContactPhone %></span>
                </span>                
            </span>
        </p>
        
        <% Html.RenderPartial("RSVPStatus"); %>
        
        <p id="whoscoming">
            <strong>Chi partecipa:</strong>
            <%if (Model.Ratings.Count == 0){%>
                  No one has rated.
            <% } %>
        </p>
        
        <%if (Model.Ratings.Count > 0)
          {%>
           <div id="whoscomingDiv">
            <ul class="attendees">
                <%
              var Ratings = Model.Ratings.Reverse();      
                    foreach (var Rating in Ratings){%>
                  <li class="attendee">
                    <span class="vcard">
                        <span class="fn nickname"><%:Rating.AttendeeName.StartsWith("@") ? Rating.AttendeeName : Rating.AttendeeName.Replace("@", " at ").Truncate(30)%></span>
                    </span>
                  </li>
                <% } %>
            </ul>
          </div>
        <%} %>
        
        <% Html.RenderPartial("EditAndDeleteLinks"); %>    
        
    </div>
    
    <div id="mapDiv">
        <% Html.RenderPartial("map"); %>    
        <p>
             <img src="/content/img/microformat_hcalendar.png" alt="hCalendar"/>
        </p>
    </div>   
<div id="disqus_thread"></div>
<script type="text/javascript">
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'dovesibutta'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function () {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>

         
</asp:Content> 

